/*
 * Parameters.java
 *
 * Created on Mar 25, 2007, 22:07
 *
 * Copyright (c) 2007 Daniel Gronau
 *
 * This file is part of KanjiTori.
 *
 * KanjiTori is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * KanjiTori is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 *
 */

package kanjitori.util;

import com.jme.renderer.ColorRGBA;
import java.awt.Color;
import java.awt.Font;

/**
 *
 * @author Pirx
 */
public class Parameters {
    
    /** do not instatiate */
    private Parameters() {
    }
    
    public static Boolean getBoolean(String value) {
        if (value == null) {
            return null;
        }
        try {
            return Boolean.valueOf(value);
        } catch (NumberFormatException ex) {
            return null;
        }
    }
    
    
    public static Integer getInt(String value) {
        if (value == null) {
            return null;
        }
        try {
            return Integer.valueOf(value);
        } catch (NumberFormatException ex) {
            return null;
        }
    }
    
    public static Float getFloat(String value) {
        if (value == null) {
            return null;
        }
        try {
            return Float.valueOf(value);
        } catch (NumberFormatException ex) {
            return null;
        }
    }
    
    public static Color getColor(String value) {
        return Cache.getColor(value);
    }
    
    public static ColorRGBA getColorRGBA(String value) {
       return Cache.getColorRGBA(value);
    }
    
    public static Font getFont(String value) {
       return Cache.getFont(value);
    }
    
}
